/**************************************************************************************
*
*	Copyright (C) 2009 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	RenderStage.h
*
*	Description -	Abstract base rendering stage.
*
*	Comments	-	Custom rendering stages must derive from this class.
*
*	Modification History:
*			Name			   Date					Description
*			CodeSushi	-	11/02/2009	-	Creation of this file
**************************************************************************************/

#ifndef _PSX_RENDER_STAGE_H_
#define _PSX_RENDER_STAGE_H_

#include "PulseSTD.h"

namespace Pulse
{

	class RenderStage
	{
	public:

		RenderStage( void );

		virtual ~RenderStage( void );

		virtual EErrorCode::Type Initialize( void ) { return EErrorCode::NONE; }

		virtual void Cleanup( void ) { }

		virtual void BeginRender( void ) { }

		virtual void PreRender( void ) { }

		virtual void Render( void ) = 0;

		virtual void PostRender( void ) { }

		virtual void EndRender( void ) { }

		void SetEnabled( BOOL bEnabled ) { m_bEnabled = bEnabled; } 

		BOOL IsEnabled( void ) { return m_bEnabled; }

		void SetPriority( UINT value );

		UINT GetPriority( void ) const { return m_priority; }

		void SetRenderer( Renderer *pRenderer ) { m_pRenderer = pRenderer; }

		void ToggleEnabled( void ) { m_bEnabled = !m_bEnabled; }

		BOOL IsEnabled( void ) const { return m_bEnabled; }

	protected:

		Renderer	*m_pRenderer;
		BOOL		m_bEnabled;
		UINT		m_priority;

	};

}

#endif /* _PSX_RENDER_STAGE_H_ */